package sorting;

public class SortUtils
{
    public static void swap(int[] array, int pos1, int pos2) 
    {
        int temp = array[pos1];
        array[pos1] = array[pos2];
        array[pos2] = temp;
    }

    public static void main(String[] args)
    {
        int[] array = new int [2];
        array[0] = 1;
        array[1] = 2;
        System.out.println("Array: " + array[0] + " " + array[1]);
        swap(array, 0, 1);
        System.out.println("Array: " + array[0] + " " + array[1]);
    }
}
